﻿using System;
using System.Collections.Generic;

namespace BSharp.Compiler
{
	public class CodeBlock : AstNode
	{
		private List<AstNode> children = new List<AstNode> ();

		public CodeBlock (SourceLocation location)
			: base (location)
		{
		}

		public void AddItem (AstNode item)
		{
			children.Add (item);
		}

		public override void Visit (AstVisitor visitor)
		{
			visitor.Accept (this);
		}

		public override void VisitChildren (AstVisitor visitor)
		{
			foreach (AstNode child in children) {
				child.Visit (visitor);
			}
		}

	}
}

